package com.zth.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zth.dao.TbUserMapper;
import com.zth.entity.MyPage;
import com.zth.entity.TbUser;
import com.zth.service.TbUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service//业务处理层
public class TbUserServiceImpl implements TbUserService {

    @Autowired
    private TbUserMapper userMapper;


//    @Override
//    public List<TbUser> findAll() {
//        return userMapper.findAll();
//    }

    @Override
    public List<TbUser> findAll() {
        return userMapper.selectAll();
    }

    @Override
    public PageInfo queryByPage(MyPage page) {
        PageHelper.startPage(page.getPage(), page.getLimit());

        return new PageInfo(userMapper.findAll());
    }
}
